<%@page contentType="text/html; charset=UTF-8" language="java" %>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.util.*" %>
<%@page import="com.mew.util.*" %>
<%@page import="com.humyu.school.corebase.*" %>
<% request.setCharacterEncoding("UTF-8");%>
<html>
<head>
<title></title>
<script language="JavaScript">
function delete_confirm(){
 if(confirm("删除后将不能恢复，您确认执行删除操作么？")==true){
	return true;
 }
 return false;
}
</script>
<link href="css/common.css" rel="stylesheet" type="text/css">
</head>
<body>
<p align="center"><strong>ID卡终端管理</strong></p>
<form name="form1" method="post" action="<%=com.humyu.servlet.DispatcherServlet.PREFIX%>do" target="mainFrame">
  <table width="100%" border="0">
    <tr>
      <td width="60%"><strong>读卡器客户端登录ID：</strong>
        <input name="LoginName" type="text" id="LoginName"> <input type="submit" name="Submit" value="查　询">
        <input name="action" type="hidden" id="action" value="CARDCLIENTSEARCH"></td>
      <td width="40%"><font color="#000000"><a href="<%=com.humyu.servlet.DispatcherServlet.PREFIX%>do?action=DOCARDCLIENTADD"  target="mainFrame"><strong>添加读卡器客户</strong></a></font></td>
    </tr>
  </table>
</form>
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#BBD1FC">
  <tr align="center" bgcolor="#CCCCFF">
    <td width="10%"><strong>登录ID</strong></td>
    <td width="10%"><strong>联系人</strong></td>
    <td width="10%"><strong>联系电话</strong></td>
    <td width="15%"><strong>客户端描述</strong></td>
    <td width="40%"><strong>读卡器状态</strong></td>
    <td width="5%"><strong><font color="#00CC00">重置</font></strong></td>
    <td width="5%"><strong><font color="#0000FF">修改</font></strong></td>
    <td width="5%"><strong><font color="#FF0000">删除</font></strong></td>
  </tr>
  <%
          Iterator iterator= (Iterator)request.getAttribute("cardclient");
          if(iterator!=null){
                  while(iterator.hasNext()){
                          CardClient cardClient = (CardClient)iterator.next();
                          if(cardClient!=null){
						  	Iterator iterator1 = cardClient.getCarderReaderMap().values().iterator();
						    String cardStatus = "&nbsp;";
							while(iterator1.hasNext()){
							  CardReader cr = (CardReader)iterator1.next();
							  if(cr.getCardReadStatus()==CardReader.OK){
								cardStatus = cardStatus + "<font color='green'>"+cr.getCardReaderID()+"</font>&nbsp;&nbsp;&nbsp;&nbsp;";
							  }else{
								cardStatus = cardStatus + "<font color='red'>"+cr.getCardReaderID()+"</font>&nbsp;&nbsp;&nbsp;&nbsp;";
							  }
							}
						  	out.println("<tr align='center'>");
   							out.println("<td>&nbsp;"+cardClient.getCardClientLogin()+"</td>");
    						out.println("<td>&nbsp;"+cardClient.getEmergenceMan()+"</td>");
							out.println("<td>&nbsp;"+cardClient.getEmergenceLink()+"</td>");
							out.println("<td>&nbsp;"+cardClient.getCardClientDesc()+"</td>");
							out.println("<td>&nbsp;"+cardStatus+"</td>");
							out.println("<td><font color='#00CC00'><a href="+com.humyu.servlet.DispatcherServlet.PREFIX+"do?action=CARDCLIENTRESET&LoginName="+cardClient.getCardClientLogin()+">重置</a></font></td>");
							out.println("<td><font color='#0000FF'><a href="+com.humyu.servlet.DispatcherServlet.PREFIX+"do?action=DOCARDCLIENTMOD&LoginName="+cardClient.getCardClientLogin()+">修改</a></font></td>");
							out.println("<td><font color='#FF0000'>删除</a></font></td>");
							out.println("</tr>");
						  }
				}
		}
  %>
</table>
<p align="center"> 
  <input type="button" name="Button" value="刷　新" onClick="history.go(0)">
</p>
</body>
</html>